package com.heima.article.feign;

import com.heima.apis.article.IArticleClient;
import com.heima.article.service.ApArticleService;
import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.enums.AppHttpCodeEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description TODO
 * @Author bo.li
 * @Date 2022/11/11 9:56
 * @Version 1.0
 */
@RestController
@Slf4j
public class ArticleClient implements IArticleClient{


    @Autowired
    private ApArticleService articleService;

    @Override
    public ResponseResult saveArticle(ArticleDto dto) {
        log.info("收到参数:{}",dto);
        try {
            return articleService.saveArticle(dto);
        }catch (Exception e){

        }
        return ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR);
    }
}